/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package OilSimNoteBook;

import java.awt.Container;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextArea;

public class IntroPane extends OilSimUIComponent implements ActionListener{
    public static final String START_CLICKED = "START_BUTTON_CLICKED";
    private JPanel mainPanel;
    private JLabel titleLab, developer, supervisor;
    JButton startButton;
    JTextArea subtitle;

    public IntroPane() {
        mainPanel = new JPanel();
        mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.PAGE_AXIS));
        
        titleLab = new JLabel("OilSim Simulation Notebook");
        mainPanel.add(titleLab);
        
        subtitle = new JTextArea(getSubtitleText());
        subtitle.setLineWrap(true);
        subtitle.setEditable(false);
        mainPanel.add(subtitle);
        
        developer = new JLabel("Developed By: Obialo");
        supervisor = new JLabel("Supervised By: Obialo's brother");
        
        mainPanel.add(developer);
        mainPanel.add(supervisor);
        
        startButton = new JButton("Start");
        mainPanel.add(startButton);
        
        startButton.addActionListener(this);
        mainPanel.setPreferredSize(new Dimension(700, 500));
    }

    private String getSubtitleText() {
        StringBuilder txt = new StringBuilder("For the award of a masters degree in oil and gas ");
        txt.append("Information technology from the school of computer science and ");
        txt.append("degital media at the University of Robert Gordon, Aberdeen");
        return txt.toString();
    }
    
    

    @Override
    public Container getPanel() {
        return mainPanel;
    }
    
    @Override
    public void actionPerformed(ActionEvent e) {
        if (e.getActionCommand().equals(startButton.getActionCommand())){
            setChanged();
            notifyObservers(START_CLICKED);
            System.out.println("BUTTON CLIKED...");
        }
    }
    
    public static void main(String[] args) {
        new IntroPane().showFrame();
    }

    
    
    
}
